<div class="row-content layer-cf">
    <div class="row">
        <div class="layer-u-sm-12 layer-u-md-12 layer-u-lg-12">
            <div class="widget layer-cf ">
                <div class="widget-head layer-cf">
                    <div class="widget-title layer-cf">用户列表</div>
                </div>
                <div class="widget-body layer-fr">
                    <!-- 工具栏 -->
                    <div class="page_toolbar layer-margin-bottom-xs layer-cf">
                        <form class="toolbar-form" method="post" action="{Url('User/index')}">
                            <input type="hidden" nlayere="s" value="/{$request->pathinfo()}">
                            <div class="layer-u-sm-12 layer-u-md-9 layer-u-sm-push-3">
                                <div class="layer fr">
                                    <div class="layer-form-group layer-fl">
                                       {$gender = $request->get('gender')}
                                        <select name="gender"
                                                data-layer-selected="{btnSize: 'sm', placeholder: '性别'}">
                                            <option value=""></option>
                                            <option value="-1"
                                                {$gender === '-1' ? 'selected' : ''}>全部
                                            </option>
                                            <option value="1"
                                                {$gender === '1' ? 'selected' : ''}>男
                                            </option>
                                            <option value="2"
                                                {$gender === '2' ? 'selected' : ''}>女
                                            </option>
                                            <option value="0"
                                                {$gender === '0' ? 'selected' : ''}>未知
                                            </option>
                                        </select>
                                    </div>
                                    <div class="layer-form-group layer-fl">
                                        <div class="layer-input-group layer-input-group-sm tpl-form-border-form">
                                            <input name="nickName" type="text" class="layer-form-field"
                                                   placeholder="请输入微信昵称"
                                                   value="{$request->get('nickName ')}">
                                            <div class="layer-input-group-btn">
                                                <button class="layer-btn layer-btn-default layer-icon-search"
                                                        type="submit"></button>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </form>
                    </div>

                    <div class="layer-scrollable-horizontal layer-u-sm-12">
                        <table width="100%" class="layer-table layer-table-compact layer-table-striped
                         tpl-table-black layer-text-nowrap">
                            <thead>
                            <tr>
                                <th>用户ID</th>
                                <th>头像</th>
                                <th>昵称</th>
                                <th>累积消费</th>
                                <th>性别</th>
                                <th>国家</th>
                                <th>省份</th>
                                <th>城市</th>
                                <th>注册时间</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            {if (!$list->isEmpty())}{foreach ($list as $item)}
                                <tr>
                                    <td class="layer-text-middle">{$item['user_id']}</td>
                                    <td class="layer-text-middle">
                                        <a href="{$item['avatarUrl']}" title="点击查看大图" target="_blank">
                                            <img src="{$item['avatarUrl']}" width="72" height="72" alt="">
                                        </a>
                                    </td>
                                    <td class="layer-text-middle">{$item['nickName']}</td>
                                    <td class="layer-text-middle">{$item['money']}</td>
                                    <td class="layer-text-middle">{$item['gender']}</td>
                                    <td class="layer-text-middle">{$item['country'] ?: '--'}</td>
                                    <td class="layer-text-middle">{$item['province'] ?: '--'}</td>
                                    <td class="layer-text-middle">{$item['city'] ?: '--'}</td>
                                    <td class="layer-text-middle">{$item['create_time']}</td>
                                    <td class="layer-text-middle">
                                        <div class="tpl-table-black-operation">
											<a class="tpl-table-black-operation-warning" href="{:url('order/all_list',
                                                ['user_id' => $item['user_id']])}"
                                               class="tpl-table-black-operation-del"
                                               data-id="{$item['user_id']}">
                                                <i class="layer-icon-pencil"></i> 订单
                                            </a>
											<a class="tpl-table-black-operation-primary" href="{:url('item.comment/index',
                                                ['user_id' => $item['user_id']])}"
                                               class="tpl-table-black-operation-del"
                                               data-id="{$item['user_id']}">
                                                <i class="layer-icon-pencil"></i> 评价
                                            </a>
											<a class="tpl-table-black-operation-primary" href="{:url('user/index',
                                                ['pid' => $item['user_id']])}"
                                               class="tpl-table-black-operation-del"
                                               data-id="{$item['user_id']}">
                                                <i class="layer-icon-pencil"></i> 推荐
                                            </a>
											 <a href="javascript:void(0);"
                                               class="item-delete tpl-table-black-operation-del"
                                               data-id="{$item['user_id']}">
                                                <i class="layer-icon-trash"></i> 删除
                                            </a>
                                        </div>
                                    </td>
                                </tr>
                            {/foreach}{else/}
                                <tr>
                                    <td colspan="10" class="layer-text-center">暂无记录</td>
                                </tr>
                           {/if}
                            </tbody>
                        </table>
                    </div>
                    <div class="layer-u-lg-12 layer-cf">
                        <div class="layer-fr">{$page|raw} </div>
                        <div class="layer-fr pagination-total layer-margin-right">
                            <div class="layer-vertical-align-middle">总记录：{$list->total()}</div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script>
    $(function () {
        // 删除元素
        var url = "{:url('user/delete')}";
	
        $('.item-delete').delete('user_id', url, '删除后不可恢复，确定要删除吗？');

    });
</script>

